package thinkingJava.chapter13;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Resetting {
	public static void main(String[] args) {
		String regex = "[frb][aiu][gx]";
		Pattern p = Pattern.compile(regex);
		Matcher m = p.matcher("fix the rug with bags");
		while (m.find()) {
			System.out.println(m.group());
		}
		System.out.println("-----------------------------");
		m.reset("fix the rig with rags");
//		m.reset();
		while (m.find()) {
			System.out.println(m.group());
		}
	}
}
